<template>
  <router-view />
</template>

<script setup>
import {onMounted } from 'vue'
import axios from 'axios';
import config from '@/config.js';

onMounted(() => {
  if (config.mode == 'production') {//版本检查
      axios.get(config.webappBaseUrl + '/version.json?timestep=' + Date.now()).then(res => {
          var initVersion = res.data.version;
          var checkVserion = setInterval(() => {
              axios.get('/version.json?timestep=' + Date.now()).then(res => {
                  if (initVersion != res.data.version) {
                    clearInterval(checkVserion);
                    location.reload();
                  }
              });
          }, 5 * 1000);
      });
  }
});
</script>
